<template>
  <div id="app">
    <Theader></Theader>
    <div class="tab">
      <div class="tab-item">
        <router-link to="/">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/evaluate">评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/seller">商家</router-link>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
import image from '@/common/img/resource/img/foods1.jpg'
import cart from './components/cart'
import Theader from './components/header'
export default {
  name: 'App',
  components: {
    Theader,
    cart
  },
  data () {
    return {
      menuList: [{
        id: '1',
        name: '热销榜',
        foodlist: [{
          id: '10',
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 100,
          num: 0
        }, {
          id: '11',
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '2',
        name: '单人特色套餐',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 2,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 10,
          num: 0
        }]
      }, {
        id: '3',
        name: '特色粥品',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '4',
        name: '精选热菜',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '5',
        name: '爽口凉菜',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '6',
        name: '半成品',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '7',
        name: '饭类',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }, {
        id: '8',
        name: '面类',
        foodlist: [{
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }, {
          image: image,
          title: '皮蛋廋肉粥配包子套餐',
          classification: '咸粥',
          number: '1132',
          praise: '100%',
          price: 28,
          num: 0
        }]
      }],
      itemclass: 1,
      showc: true,
      distributionfee: 40
    }
  },
  computed: {
    selectFoods () {
      let foods = []
      this.menuList.forEach((menuList) => {
        menuList.foodlist.forEach((foodlist) => {
          if (foodlist.num > 0) {
            foods.push(foodlist)
          }
        })
      })
      return foods
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
body {
    margin: 0;
}
.tab{
width: 100%;
display: flex;
height: 40px;
line-height: 40px;
}
.tab-item{
  flex: 1;
  text-align: center;
}
a{
  text-decoration: none;
  display: black;
  color: #4d555d;
  font-size: 14px;
}
a.router-link-exact-active{
  color:#f01414;
}
</style>
